<template>
  <el-dialog
    class="eldialog el-dialog-m0"
    :visible.sync="visible"
    :title="title"
    :close-on-click-modal="false"
    append-to-body
    top="2vh"
    width="100%"
    :close-on-press-escape="false"
    element-loading-text="数据加载中"
    v-loading="loading"
  >
    <el-form :inline="true" :model="msgData" :rules="rules" ref="msgData" class="demo-form-inline">
      <el-row>
        <el-col :span="24" align="center">
          <el-form-item prop="dw">
            <el-input :disabled="flag" maxlength="30" size="small" placeholder="请输入单位名称" v-model="msgData.dw"></el-input>
          </el-form-item>
          <span style="font-size: 28px;line-height: 32px;font-weight: 900;height: 50px;">2023年度年轻干部年度完成情况统计表</span>
          <el-button style="margin-right: 30px;margin-top: 10px;float: right" type="primary" plain @click="downZip"
          >&nbsp;导出<i class="el-icon-upload el-icon--right"></i>
          </el-button>

          <el-button v-if="btType === '2'" style="margin-right: 10px;margin-top: 10px;float: right" type="primary"
                     icon="el-icon-edit" plain
                     @click="auditTable()" :disabled="shztEnd === '1' || shztGHB === '1'">&nbsp;审核
          </el-button>
          <el-button v-if="btType === '2' && (shztEnd === '1'||shztGHB === '1')"
                     style="margin-right: 10px;margin-top: 10px;float: right" type="primary" icon="el-icon-edit" plain
                     @click="flag = false;shztEnd = '0';shztGHB = '0'">&nbsp;修改
          </el-button>
          <el-button v-if="role == '系统管理员'" style="margin-right: 10px;margin-top: 10px;float: right" type="primary"
                     icon="el-icon-edit" plain
                     @click="save('msgData')">&nbsp;保存
          </el-button>
          <el-button v-else style="margin-right: 10px;margin-top: 10px;float: right" type="primary" icon="el-icon-edit"
                     plain
                     @click="save('msgData')" :disabled="flag">&nbsp;保存
          </el-button>
        </el-col>
      </el-row>
      <el-row>
        <el-form-item label="填表人：" prop="tbr">
          <el-input :disabled="flag" maxlength="15" size="small" placeholder="请输入填表人姓名"
                    v-model="msgData.tbr">
          </el-input>
        </el-form-item>
        <el-form-item label="联系方式：" prop="lxfs">
          <el-input :disabled="flag" size="small" placeholder="请输入联系方式"
                    oninput="if(value.length>15)value=value.slice(0,15)"
                    v-model="msgData.lxfs">
          </el-input>
        </el-form-item>
        <el-form-item  label="表格盖章扫描:" >
          <div v-if="excelData.excelFile == ''">
            <el-upload style="margin-bottom: 5px"   class="upload-demo"
                       accept=".pdf"
                       :action="fileServerPath"
                       :show-file-list="false"
                       :on-success="(response, file, fileList)=> excelFileUpload(response, file, fileList)"
                       :before-upload="beforeAvatarUpload"
                       :multiple="false"
                       :disabled="flag">
              <el-button :disabled="flag" size="small" type="primary">
                上传<i class="el-icon-upload el-icon--right"></i>
              </el-button>
            </el-upload>
          </div>
          <div v-else-if="excelData.excelFile != '' && flag == true">
            <el-link   type="primary"  @click="showFile(excelData.excelFile)">
              {{excelData.excelFileName}}
            </el-link>
          </div>
          <div v-else>
            <el-upload style="margin-bottom: 5px"   class="upload-demo"
                       accept=".pdf"
                       :action="fileServerPath"
                       :show-file-list="false"
                       :on-success="(response, file, fileList)=> excelFileUpload(response, file, fileList)"
                       :before-upload="beforeAvatarUpload"
                       :multiple="false"
                       :disabled="flag">
              <a>{{excelData.excelFileName}}</a>
            </el-upload>
          </div>
        </el-form-item>
      </el-row>
    </el-form>
    <el-row>
      <vxe-table style="width: 100%"
                border
                :data="wcqktjData">
        <vxe-colgroup 
          width="25%"
          title="市级党政工作部门正职"
          align="center">
          <vxe-column
            title="批复职数"
            width="90px"
            align="center">
            <template slot-scope="scope">
              <el-input :disabled="flag" onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.sjzzPfzs = $event.target.value"
                        v-model="scope.row.sjzzPfzs">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2022年底</div>
              <div>配备41岁以下</div>
              <div>干部人数</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.sjzzPb2022 = $event.target.value"
                        v-model="scope.row.sjzzPb2022">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2023年内</div>
              <div>计划补充</div>
              <div>41岁以下</div>
              <div>干部人数</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.sjzzBc2023 = $event.target.value"
                        v-model="scope.row.sjzzBc2023">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2023年底</div>
              <div>41岁以下</div>
              <div>干部人数</div>
              <div>计划达到</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.sjzzJh2023 = $event.target.value"
                        v-model="scope.row.sjzzJh2023">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2023年底</div>
              <div>配备41岁以下</div>
              <div>干部人数</div>
            </template>
            <template slot-scope="scope">
              <el-input :disabled="flag" onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.sjzzPb2023 = $event.target.value"
                        v-model="scope.row.sjzzPb2023">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>全省干部</div>
              <div>数据中心</div>
              <div>筛选41岁以下</div>
              <div>干部人数</div>
            </template>
            <template slot-scope="scope">
              <!--<el-input :disabled="flag" onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.sjdzSx41nsl = $event.target.value"
                        v-model="scope.row.sjdzSx41nsl">
              </el-input>-->
              <el-button  type="text"  :disabled="scope.row.sjdzSx41nsl==0"
                          @click="detailList('nl','', 'ldLx', '41岁以下正职人数')"
                          size="small">{{sjdzSx41nsl}}</el-button>
            </template>
          </vxe-column>
        </vxe-colgroup>
        <vxe-colgroup
          width="25%"
          title="县（市、区）党政正职"
          align="center">
          <vxe-column
            title="批复职数"
            width="90px"
            align="center">
            <template slot-scope="scope">
              <el-input :disabled="flag" onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xjzzPfzs = $event.target.value"
                        v-model="scope.row.xjzzPfzs">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2022年底</div>
              <div>配备41岁以下</div>
              <div>干部人数</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xjzzPb2022 = $event.target.value"
                        v-model="scope.row.xjzzPb2022">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2022年底</div>
              <div>配备41岁以下</div>
              <div>干部占比（%）</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xjzzZb2022 = $event.target.value"
                        v-model="scope.row.xjzzZb2022">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2023年内</div>
              <div>计划补充</div>
              <div>41岁以下</div>
              <div>干部人数</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xzdzSx36nsl = $event.target.value"
                        v-model="scope.row.xjzzBc2023">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2023年底</div>
              <div>41岁以下</div>
              <div>干部人数</div>
              <div>计划达到</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xjzzJh2023 = $event.target.value"
                        v-model="scope.row.xjzzJh2023">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2023年底</div>
              <div>配备41岁以下</div>
              <div>干部人数</div>
            </template>
            <template slot-scope="scope">
              <el-input :disabled="flag" onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xjzzPb2023 = $event.target.value"
                        v-model="scope.row.xjzzPb2023">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2023年底</div>
              <div>41岁以下</div>
              <div>干部占比（%）</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xjzzZb2023 = $event.target.value"
                        v-model="scope.row.xjzzZb2023">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>全省干部</div>
              <div>数据中心</div>
              <div>筛选41岁以下</div>
              <div>干部人数</div>
            </template>
            <template slot-scope="scope">
             <!-- <el-input :disabled="flag" onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.qxdzSx41nsl = $event.target.value"
                        v-model="scope.row.qxdzSx41nsl">
              </el-input>-->
              <el-button  type="text" :disabled="scope.row.qxdzSx41nsl==0"
              @click="detailList2('2','nlldLx','1','41岁以下党政正职数')"
              size="small">{{qxdzSx41nsl}}</el-button>
            </template>
          </vxe-column>
        </vxe-colgroup>
      </vxe-table>
    </el-row>
    <el-row>
      <vxe-table style="width: 100%"
                border
                :data="wcqktjData">
        <vxe-colgroup
          width="25%"
          title="县级党政领导班子"
          align="center">
          <vxe-column
            title="批复职数"
            width="90px"
            align="center">
            <template slot-scope="scope">
              <el-input :disabled="flag" onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xjbzPfzs = $event.target.value"
                        v-model="scope.row.xjbzPfzs">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2022年底</div>
              <div>配备41岁以下</div>
              <div>干部人数</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xjbzPb2022 = $event.target.value"
                        v-model="scope.row.xjbzPb2022">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2022年底</div>
              <div>配备41岁以下</div>
              <div>干部占比（%）</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xjbzZb2022 = $event.target.value"
                        v-model="scope.row.xjbzZb2022">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2023年内</div>
              <div>计划补充</div>
              <div>41岁以下</div>
              <div>干部人数</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xjbzBc2023 = $event.target.value"
                        v-model="scope.row.xjbzBc2023">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2023年底</div>
              <div>41岁以下</div>
              <div>干部人数</div>
              <div>计划达到</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xjbzJh2023 = $event.target.value"
                        v-model="scope.row.xjbzJh2023">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2023年底</div>
              <div>配备41岁以下</div>
              <div>干部人数</div>
            </template>
            <template slot-scope="scope">
              <el-input :disabled="flag" onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xjbzPb2023 = $event.target.value"
                        v-model="scope.row.xjbzPb2023">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2023年底</div>
              <div>41岁以下</div>
              <div>干部占比（%）</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xjbzZb2023 = $event.target.value"
                        v-model="scope.row.xjbzZb2023">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>全省干部</div>
              <div>数据中心</div>
              <div>筛选41岁以下</div>
              <div>干部人数</div>
            </template>
            <template slot-scope="scope">
              <!--<el-input :disabled="flag" onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xjldSx41nsl = $event.target.value"
                        v-model="scope.row.xjldSx41nsl">
              </el-input>-->
              <el-button  type="text" :disabled="scope.row.xjldSx41nsl==0"
                          @click="detailList2( '2','41nl','1','41岁以下干部数')"
                          size="small">{{xjldSx41nsl}}</el-button>
            </template>
          </vxe-column>

        </vxe-colgroup>
        <vxe-colgroup
          width="25%"
          title="乡镇（街道）党政正职"
          align="center">
          <vxe-column
            title="批复职数"
            width="90px"
            align="center">
            <template slot-scope="scope">
              <el-input :disabled="flag" onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xzzzPfzs = $event.target.value"
                        v-model="scope.row.xzzzPfzs">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2022年底</div>
              <div>配备36岁以下</div>
              <div>干部人数</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xzzzPb2022 = $event.target.value"
                        v-model="scope.row.xzzzPb2022">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2022年底</div>
              <div>配备36岁以下</div>
              <div>干部占比（%）</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xzzzZb2022 = $event.target.value"
                        v-model="scope.row.xzzzZb2022">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2023年内</div>
              <div>计划补充</div>
              <div>36岁以下</div>
              <div>干部人数</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xzzzBc2023 = $event.target.value"
                        v-model="scope.row.xzzzBc2023">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2023年底</div>
              <div>36岁以下</div>
              <div>干部人数</div>
              <div>计划达到</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xzzzJh2023 = $event.target.value"
                        v-model="scope.row.xzzzJh2023">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2023年底</div>
              <div>配备36岁以下</div>
              <div>干部人数</div>
            </template>
            <template slot-scope="scope">
              <el-input :disabled="flag" onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xzzzPb2023 = $event.target.value"
                        v-model="scope.row.xzzzPb2023">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>2023年底</div>
              <div>36岁以下</div>
              <div>干部占比（%）</div>
            </template>
            <template slot-scope="scope">
              <el-input disabled onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xzzzZb2023 = $event.target.value"
                        v-model="scope.row.xzzzZb2023">
              </el-input>
            </template>
          </vxe-column>
          <vxe-column
            align="center">
            <template slot="header">      
              <div>全省干部</div>
              <div>数据中心</div>
              <div>筛选36岁以下</div>
              <div>干部人数</div>
            </template>
            <template slot-scope="scope">
              <!--<el-input :disabled="flag" onkeyup="value=value.replace(/^\D*(\d*).*/g, '$1')"  @blur="scope.row.xzdzSx36nsl = $event.target.value"
                        v-model="scope.row.xzdzSx36nsl">
              </el-input>-->
              <el-button  type="text" :disabled="scope.row.xzdzSx36nsl ==0"
                          @click="detailList2('2','36nlldLx','2','36岁以下干部数')"
                          size="small">{{xzdzSx36nsl}}</el-button>
            </template>
          </vxe-column>
        </vxe-colgroup>
      </vxe-table>
    </el-row>
    <archiveFile-show ref="dialogarchiveFile"/>
    <detail-add v-if="showTypeList" ref="dialogSumCardreList"   />
  </el-dialog>
</template>

<script>

  /*方法引用*/
  import {getList2023, save2023,downLsqk2023,auditTable} from '@/api/young/evaluation/infoFilling/infoFilling.js';
  import webapp from "@/config/webapp";
  import store from '@/store'
  import detailAlert from './detailAlert'
  import { getSzWarningEightTable,getSzWarningNineTableCounty} from '@/api/young/echarts/cadre/cadreNew'
  import archiveFileShow from "@/views/young/evaluation/archiveFile";

  export default {
    name: "wcqktjTable2023_ds",
    components: {
      'archiveFile-show': archiveFileShow,
      'detail-add': detailAlert,
    },
    data() {
      return {
        title: '完成情况统计表',
        visible: false,
        pdfUrl: '',
        heightY: window.innerHeight - 90 + 'px',
        heightZ: window.innerHeight - 360 + 'px',
        widthY: window.innerWidth / 2 - 50 + 'px',
        fileServerPath: webapp.GHB_URL+'/evaluation/excel/fileUpload',

        loading: false,
        flag:false,
        btType:'',
        role:'',
        shztEnd:'',
        shztGHB:'',
        taskId: '',
        wcqktjData: [],
        msgData: {
          "id": "",
          "dw": "",
          "tbr": "",
          "lxfs": "",
          "taskId": "",
          "sjd": ""
        },
        excelData: {
          "excelFile":"",
          "excelFileName":"",
        },
        rules: {
          tbr: [
            {required: true, message: '请输入填表人姓名', trigger: 'blur'}
          ],
          lxfs: [
            {required: true, message: '请输入联系方式', trigger: 'blur'}
          ],
          dw: [
            {required: true, message: '请输入联系方式', trigger: 'blur'}
          ],
        },
          reg : /^([1-9][0-9]*|0)(\.[0-9]*[1-9])?$/,
          codeId:"",
          showTypeList: false,
          sjdzSx41nsl:"",
          qxdzSx41nsl:"",
          xjldSx41nsl:"",
          xzdzSx36nsl:"",
      }
    },
    watch : {
      wcqktjData: {
        handler: function() {
          this.wcqktjData.forEach(item =>{
            //县级党政
            if (item.xjzzPfzs != '' && item.xjzzPfzs != null && this.reg.test(item.xjzzPfzs) && this.reg.test(item.xjzzPb2023)
              && item.xjzzPb2023 != '' && item.xjzzPb2023 != null && item.xjzzPfzs != 0) {
              item.xjzzZb2023 = ((item.xjzzPb2023 / item.xjzzPfzs) * 100).toFixed(1) + '%';
            }else  {
                if(!item.xjzzZb2023){
                    item.xjzzZb2023 = '0.0%'
                }
            }
            //县级领导班子
            if (item.xjbzPfzs != '' && item.xjbzPfzs != null && this.reg.test(item.xjbzPfzs) && this.reg.test(item.xjbzPb2023)
              && item.xjbzPb2023 != '' && item.xjbzPb2023 != null && item.xjbzPfzs != 0) {
              item.xjbzZb2023 = ((item.xjbzPb2023 / item.xjbzPfzs) * 100).toFixed(1) + '%';
            }else {
                if(!item.xjbzZb2023){
                    item.xjbzZb2023 = '0.0%'
                }
            }
            //乡镇党政
            if (item.xzzzPfzs != '' && item.xzzzPfzs != null && this.reg.test(item.xzzzPfzs) && this.reg.test(item.xzzzPb2023)
              && item.xzzzPb2023 != '' && item.xzzzPb2023 != null && item.xzzzPfzs != 0) {
              item.xzzzZb2023 = ((item.xzzzPb2023 / item.xzzzPfzs) * 100).toFixed(1) + '%';
            }else {
                if(!item.xzzzZb2023){
                    item.xzzzZb2023 = '0.0%'
                }
            }
          });
        },
        deep: true
      }
    },
    methods: {
      async initShow(task,role,shztGHB,type) {
        this.task =task;
        this.btType = type;
        this.taskId = task.id;
        this.role = role;
        this.shztGHB = shztGHB;
        this.visible = true;
        this.msgData = {};
        this.excelData.excelFileName = "";
        this.excelData.excelFile = "";
        this.wcqktjData = [];
        const params = {
          'taskId': task.id,
          'type': '5'
        };
        this.loading = true;
        getList2023(params).then((data) => {
          if (data.type) {
            if (data.resultdata.bt) {
              this.msgData = data.resultdata.bt
              this.shztEnd = data.resultdata.bt.shztEnd
            }
            if (data.resultdata.list) {
              this.wcqktjData = data.resultdata.list
              this.getSjzx(this.wcqktjData)
            }
            if (data.resultdata.excelList) {
              this.excelData.excelFile = data.resultdata.excelList[0].excelFile;
              this.excelData.excelFileName = data.resultdata.excelList[0].excelFileName;
            }
            this.loading = false;
          } else {
            this.$message.error(data.message)
          }
          if (this.shztGHB == '1' || this.shztEnd == '1'){
            console.log(111)
            this.flag = true;
          }else {
            console.log(222)
            var jgid= JSON.parse(sessionStorage.getItem(`userInfo`)).organizeId
            if (jgid !== task.dwBianma) {
              console.log(333)
              if (role == '系统管理员'||role.indexOf('干部一处')>-1||role.indexOf('干部二处')>-1||
                role.indexOf('干部三处')>-1||role.indexOf('干部四处')>-1||role.indexOf('干部五处')>-1) {
                console.log(555)
                this.flag = true;
              }else {
                console.log(666)
                this.flag = false;
              }
            }else {
              console.log(444)
              this.flag = false;
            }
          }
        })
      },
      //表格扫描附件上传函数
      excelFileUpload(response, file, fileList) {
        this.excelData.excelFile = response.url;
        this.excelData.excelFileName = file.name;
      },
      //文件格式约束
      beforeAvatarUpload(file) {
        console.log(file,'beforeFile')
        const isPDF = file.name.substring(file.name.lastIndexOf('.') + 1) === 'pdf';
        const fileSize = file.size/1024
        if (fileSize > 2*1024){
          this.$message.error('上传附件材料不能大于2M!');
          return false
        }
        if (!isPDF) {
          this.$message.error('上传的附件材料后缀只能是.pdf的文件格式!');
        }
        return isPDF;
      },
      //保存
      save(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            this.$confirm('是否保存?', '操作提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              this.msgData.taskId = this.taskId;
              this.msgData.sjd = 'end'
              this.wcqktjData.forEach((item) => {
                item.taskId = this.taskId;
              });
              const params = {
                'bt': this.msgData,
                'excelData': this.excelData,
                'data': this.wcqktjData,
                'type': '5'
              };
              this.loading = true;
              save2023(params).then((data) => {
                console.log(data.result)
                if (data.result) {
                  this.loading = false;
                  this.$message.success('保存成功!')
                  this.visible = false;
                } else {
                  this.loading = false;
                  this.$message.error(data.message)
                }
              })
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消保存'
              });
            });
          }
        });
      },

      //审核
      auditTable(){
        this.$confirm('是否审核通过?', '操作提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.msgData.taskId = this.taskId;
          this.msgData.sjd = 'begin'
           const params = {
            'id': this.msgData.id,
            'task': this.task,
            'type': '5'
          };
          this.loading = true;
          auditTable(params).then((data) => {
            if (data.result) {
              this.loading = false;
              this.$message.success('审核通过!')
              this.visible = false;
            } else {
              this.loading = false;
              this.$message.error(data.message)
            }
          })
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消审核!'
          });
        });
      },
      //文件预览
      showFile(fileurl) {
        this.$nextTick(() => {
          this.$refs.dialogarchiveFile.initShow(fileurl)
        })
      },
        //下载
        downZip(){
            const month= new Date().getMonth() + 1;
            const params = {
                taskId: this.taskId,
                type : 5,
              fileName:this.msgData.dw+"年底评估(" +
                new Date().getFullYear() +"年"+month+ "月).zip"
            }
            this.$confirm('是否下载?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.pageLoading = true;
                downLsqk2023(params).then(result => {
                    this.pageLoading = false;
                    // this.$alert('成功')
                })
            })
        },
        detailList( type,type2,type3,alertPar) {
            var orgName = this.jg
            let  par_sjzx ={}
            par_sjzx = {
                'userId': store.getters.user_id.toString(),
                'token': store.getters.token.toString(),
                'system': 'datacenter',
            }
            let  data ={}
            data['reportType']='cityDZBM'
            data['jg']=orgName;
            if(type == 'nl'){
                data['nl']=41;
            }
            if(type3 == 'ldLx'){
                data['ldLx']=1;
            }
            par_sjzx['data'] =data
            var that = this
            par_sjzx['showType']="eight"
            var danwei = orgName + "--" + alertPar
            this.showTypeList=true
            that.$nextTick(() => {
                that.$refs.dialogSumCardreList.init(par_sjzx, danwei)
            })
        },
        // 弹出干部类型列表detailList 1:机构名称，2：调用不同接口标识，3：反查人员类别，4: 类别，县级或乡镇
        detailList2(code,type,orgLb,alertPar) {
            var orgName = this.jg
            var codeId = this.codeId
            var that = this
                var data = {}
                var params = {
                    'userId': store.getters.user_id.toString(),
                    'token': store.getters.token.toString(),
                    'system': 'datacenter',
                    // SOCIAL_CREDIT_CODE:codeId,
                }
                if(orgLb == '1'){   // 县级或街道
                    data['reportType'] = 'county'
                }else {
                    data['reportType'] = 'town'// 街道
                }
                if(code == '1'){  // 所辖县市区数接口
                    if(orgName != '合计') {
                        data['jg'] = orgName
                    }
                    params['data'] = data
                    params['showType']="nineCountyAndTown"
                    var that = this
                    that.showTypeList = true
                    that.$nextTick(() => {
                        var danwei = orgName+"--"+alertPar
                        that.$refs.dialogSumCardreList.init(params, danwei)
                    })

                }else if(code = '2') {   // 人员反查
                  if(type == 'xjdz'){//1
                        data['jgLx'] = 101
                        data['SOCIAL_CREDIT_CODE']=codeId;
                  }else if(type == '41nl'){//2
                        data['nl'] = 41
                        data['jgLx'] = 101
                        data['SOCIAL_CREDIT_CODE']=codeId;
                  }else if(type == 'nlldLx'){
                        data['nl'] = 41
                        data['jgLx'] = 101
                        data['ldLx'] = 1
                        data['SOCIAL_CREDIT_CODE']=codeId;
                  }else if(type == 'xbjgLx1'){
                        data['xb'] = 2
                        data['jgLx'] = 101
                        data['SOCIAL_CREDIT_CODE']=codeId;
                  }else if(type == 'xbjgLx2'){
                        data['xb'] = 2
                        data['jgLx'] = 101
                        data['isZf'] = 1
                        data['SOCIAL_CREDIT_CODE']=codeId;
                  }else if(type == 'jznv'){
                        data['xb'] = 2
                        data['jgLx'] = 101
                        data['isZf'] =2
                        data['SOCIAL_CREDIT_CODE']=codeId;
                  }else if(type == 'xbldLx0'){
                        data['xb'] = 2
                        data['jgLx'] = 102
                        data['ldLx'] =1
                        data['SOCIAL_CREDIT_CODE']=codeId;
                  }else if(type == 'jgLxzzmm'){
                        data['jgLx'] = 103
                        data['zzmm'] =1
                        data['SOCIAL_CREDIT_CODE']=codeId;
                  }else if(type == 'mz'){
                        data['jgLx'] = 101
                        data['mz'] =1
                        data['SOCIAL_CREDIT_CODE']=codeId;
                  }else if(type == 'ldLx'){
                        data['jgLx'] = 104
                        data['ldLx'] =1
                        data['SOCIAL_CREDIT_CODE']=codeId;
                  }else if(type == '36nlldLx'){
                       data['jgLx'] = 104
                       data['ldLx'] = 1
                       data['nl']=36
                       data['SOCIAL_CREDIT_CODE']=codeId;
                  }else if(type == 'xbjgLx3'){
                       data['jgLx'] = 104
                       data['xb'] = 2
                       data['SOCIAL_CREDIT_CODE']=codeId;
                  }else if(type == 'xbldLx4'){
                       data['jgLx'] = 104
                       data['ldLx'] =1
                       data['xb'] =2
                       data['SOCIAL_CREDIT_CODE']=codeId;
                  }else if(type == 'xzzs'){
                       data['jgLx'] = 105
                       data['SOCIAL_CREDIT_CODE']=codeId;
                  }else if(type == 'xzzs35'){
                       data['jgLx'] = 105
                       data['nl'] = 35
                       data['SOCIAL_CREDIT_CODE']=codeId;
                  }else if(type == 'renda'){
                       data['jgLx'] = 106
                       data['SOCIAL_CREDIT_CODE']=codeId;
                  }
                   



                    if(orgName != '合计'){
                        data['jg'] = orgName
                    }
                    params['data'] = data
                    params['showType']="nineCityDz"
                    var that = this
                    that.showTypeList = true
                    that.$nextTick(() => {
                        var danwei = orgName+"--"+alertPar
                        that.$refs.dialogSumCardreList.init(params, danwei)
                    })
                }

        },
        async getSjzx(tableData){
            // console.log(tableData,"table1234")
            tableData.forEach(item =>{
                item.sjdzSx41nsl =0
                item.qxdzSx41nsl =0
                item.xjldSx41nsl =0
                item.xzdzSx36nsl =0
            } )
            const params_sjzx = {
                'userId': store.getters.user_id.toString(),
                'token': store.getters.token.toString(),
                'system': 'datacenter',
                'jg_id': this.task.dwBianma,//"150001"
            }
            //市级党政
            getSzWarningEightTable(params_sjzx).then(data => {
                if(data.resultdata.length>0){
                    this.wcqktjData.forEach(item =>{
                        // item.sjdzSx41nsl =data.resultdata[0].down41Zz
                        this.sjdzSx41nsl = this.$set(item, 'sjdzSx41nsl', data.resultdata[0].down41Zz);
                    } )
                    console.log(this.wcqktjData,"table")
                    this.jg=data.resultdata[0].SOCIAL_CREDIT_CODE
                }
            })

            //县级党政领导班子配备情况+乡镇（街道）党政领导班子
            await getSzWarningNineTableCounty(params_sjzx).then(data => {
                if(data.resultdata.length>0) {
                    this.wcqktjData.forEach(item =>{
                        // item.qxdzSx41nsl =data.resultdata[0].county_down41Zz
                        // item.xjldSx41nsl =data.resultdata[0].county_down41
                        // item.xzdzSx36nsl =data.resultdata[0].town_down36
                        this.qxdzSx41nsl = this.$set(item, 'qxdzSx41nsl', data.resultdata[0].county_down41Zz);
                        this.xjldSx41nsl = this.$set(item, 'xjldSx41nsl', data.resultdata[0].county_down41);
                        this.xzdzSx36nsl = this.$set(item, 'xzdzSx36nsl', data.resultdata[0].town_down36);
                    } )
                    this.codeId = data.resultdata[0].county_SOCIAL_CREDIT_CODE
                }
            })
        }
    }
  }
</script>

<style scoped>
   >>>.el-input.is-disabled .el-input__inner{
    color: #606266;
  }
  /*调整表格文字*/
  >>>.vxe-header--column .vxe-cell--title{
    font-size: 14px;
    font-weight: normal;
    color:#000;
  }
  >>>.vxe-header--row{
    background:#fff;
  }
  

</style>
